import {memo, useState} from "react";

function CounterHook() {

    const [countState, setCount] = useState(0)

    return (
        <div>
            <h1>Counter Hook</h1>
            <button onClick={() => setCount(countState - 1)}>-1</button>
            <span style={{margin: '0 10px', fontSize: '30px'}}>{countState}</span>
            <button onClick={() => setCount(countState + 1)}>+1</button>
        </div>
    )
}

export default memo(CounterHook);